<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page import="org.jeecgframework.web.util.StaticValue" %>
<%@include file="/context/mytags.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <title>软件版本</title>
    <script type="text/javascript" src="plug-in/jquery/jquery-1.8.3.js"></script>
    <t:base type="ckeditor,jquery,easyui,tools,DatePicker"></t:base>
    <script type="text/javascript" src="plug-in/ckfinder/ckfinder.js"></script>
    <script type="text/javascript" src="plug-in/Validform/js/Validform_v5.3.1.js"></script>
    <script type="text/javascript">

        $(function () {
            loadTree();
        });

        function loadTree(plazaName) {
            rightTree = $("#tree").tree({
                url: "zyEmValidaRuleController.do?dataGridOfChooseEquipmentType",
                checkbox: true,
                onLoadSuccess: function (node) {
                    var protypeIds = $("#protypeId").val();
                    /*console.log("protypeIds--:"+protypeIds);*/
                    var protypeArr = protypeIds.split(",");
                    /*已勾选的id*/
                    $.each(protypeArr, function (idx, itm) {
                        var node = $("#tree").tree("find", itm);
                        if (node != undefined && node.target != undefined) {
                            $("#tree").tree("check", node.target);
                        }
                    })
                }
            });
        }

        //编写自定义JS代码
        function jiaoyan() {
            var node = $('#tree').tree('getChecked');
            var cnodeIds = '';
            var cnodeValues = '';
            for (var i = 0; i < node.length; i++) {
                cnodeIds += node[i].id + ',';
                cnodeValues += node[i].text + ',';
            }
            cnodeIds = cnodeIds.substring(0, cnodeIds.length - 1);
            cnodeValues = cnodeValues.substring(0, cnodeValues.length - 1);
            console.info("cnodeIds==" + cnodeIds);
            console.info("cnodeValues==" + cnodeValues);
            $("#zyEsitem").val(cnodeIds);
            $("#zyEsitemName").val(cnodeValues);
        }
    </script>
</head>
<body>
<t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table"
             action="softwareVersionController.do?doAdd" tiptype="1" beforeSubmit="jiaoyan">
    <input id="id" name="id" type="hidden" value="${softwareVersionPage.id }">
    <input id="createName" name="createName" type="hidden" value="${softwareVersionPage.createName }">
    <input id="createBy" name="createBy" type="hidden" value="${softwareVersionPage.createBy }">
    <input id="createDate" name="createDate" type="hidden" value="${softwareVersionPage.createDate }">
    <input id="updateName" name="updateName" type="hidden" value="${softwareVersionPage.updateName }">
    <input id="updateBy" name="updateBy" type="hidden" value="${softwareVersionPage.updateBy }">
    <input id="updateDate" name="updateDate" type="hidden" value="${softwareVersionPage.updateDate }">
    <input id="state" name="state" type="hidden" value="1">
    <table style="width: 600px;" cellpadding="0" cellspacing="1" class="formtable">
        <tr>
            <td align="right">
                <span style="color:red;">*</span><label class="Validform_label">
                    软件名称:
                </label>
            </td>
            <td class="value">
                <input id="sofeName" datatype="*" name="sofeName" nullmsg="sss" type="text" style="width: 150px" class="inputxt">
                <span class="Validform_checktip" ></span>
                <label class="Validform_label" style="display: none;">软件名称</label>
            </td>
        <tr>
            <td align="right">
                <span style="color:red;">*</span><label class="Validform_label">
                    适用机型:
                </label>
            </td>
            <td class="value">
                <input name="type" type="hidden" id="type" />
                <input class="inputxt" id="typeName" style="width: 300px" name="typeName" datatype="*" readonly="readonly"/>
                <t:choose hiddenName="type" hiddenid="id" url="softwareVersionController.do?goChooseEquipmentTypeCheckbox" name="zyEquipmentTypeList"
                          icon="icon-search" title="机型" inputTextname="typeName" textname="text" isclear="true" width="400px" height="500px" />
                <span class="Validform_checktip"></span>
                <label class="Validform_label" style="display: none;">型号</label>
            </td>
        </tr>
        <tr>
            <td align="right">
                <span style="color:red;">*</span><label class="Validform_label">
                    版本号:
                </label>
            </td>
            <td class="value">
                <input id="version" name="version" type="text" style="width: 350px" class="inputxt">
                <span class="Validform_checktip"></span>
                <label class="Validform_label" style="display: none;">版本号</label>
            </td>
        </tr>
        <tr>
            <td align="right">
                <label class="Validform_label">
                    版本说明:
                </label>
            </td>
            <td class="value">
                <textarea id="versionExplain" name="versionExplain" type="text"
                          style="width: 379px; margin: 0px; height: 150px;" class="inputxt"></textarea>
                <span class="Validform_checktip"></span>
                <label class="Validform_label" style="display: none;">版本说明</label>
            </td>
        </tr>
    </table>
</t:formvalid>
</body>
<script src="webpage/com/zybk/softwareversion/softwareVersion.js"></script>